package com.example.yjh_login.scan;


import android.widget.ImageView;

import androidx.fragment.app.FragmentTransaction;

import com.example.lib_mvp.base.AppBaseActivity;
import com.example.yjh_login.R;


/**
 * 通用扫描
 */
public class ScanActivity extends AppBaseActivity {

    ImageView titleImgGoBack;

    public static ScanActivity newInstance() {
        ScanActivity fragment = new ScanActivity();
        return fragment;
    }

    int REQUEST_ERWERMA_CODE = 1001;

    @Override
    protected int getLayoutId() {
        return R.layout.activity_scan;
    }

    @Override
    protected void initView() {
        titleImgGoBack = findViewById(R.id.title_img_go_back);
        titleImgGoBack.setOnClickListener(v -> finish());
    }

    @Override
    protected void initData() {
        init();
    }

    protected void init() {
// 创建扫描Fragment的实例
        ScanFragment scanFragment = new ScanFragment();
        // 将扫描Fragment添加到布局中
        FragmentTransaction transaction = getSupportFragmentManager().beginTransaction();
        transaction.replace(R.id.fragment_container, scanFragment);
        transaction.commit();
    }
}
